/*
 *The code is written by NaLi, All rights reserved.
 */
package com.nali.dal.statement.function.formatter;

import java.math.BigInteger;

import org.springframework.stereotype.Component;

import com.nali.dal.statement.function.FunctionException;
import com.nali.dal.statement.function.SingleArgumentDataHandler;

/**
 * @author gavin 
 * Created on 2011-4-12
 */
@Component
public class BigIntegerToLong extends SingleArgumentDataHandler<BigInteger, Long>{

	@Override
	protected Long handle(BigInteger argument) throws FunctionException {
		if (argument instanceof BigInteger) {
			return ((BigInteger) argument).longValue();
		}else{
			return null;
		}
	}
}

